package fm.last.api
{
    import flash.net.URLRequestMethod;
    import flash.net.URLVariables;
    
    import fm.last.Agent;
    import fm.last.RestAPI;
    
    final public class TasteometerAPI extends RestAPI
    {
        // those in comment are not implemented yet
        public static const TASTEOMETER_COMPARE:String = "tasteometer.compare";
        
        public function TasteometerAPI(agent:Agent)
        {
            super(agent);
        }

        /* ********************************************************************/
        
        //        public static const TASTEOMETER_COMPARE:String = "tasteometer.compare";
        /** tasteometer.compare */
        public function compare(onComplete:Function, 
                                onError:Function,
                                type1:String,
                                type2:String,
                                value1:String,
                                value2:String, 
                                limit:int=-1):void
        {
            var urlVars:URLVariables = new URLVariables();
            urlVars["method"] = TasteometerAPI.TASTEOMETER_COMPARE;
            urlVars["type1"] = type1;
            urlVars["type2"] = type2;
            urlVars["value1"] = value1;
            urlVars["value2"] = value2;
            if (limit>0) urlVars["limit"] = limit;
            requestAPI(URLRequestMethod.GET, urlVars, false, onComplete, onError);        
        }
        
    }
}